/**
 * ...
 * @author Thot
 */

function GameEventProxy()
{
	this.init( GameEventProxy.NAME, new Array() );
}

POO.extend( GameEventProxy, Proxy );


	// static
	
	GameEventProxy.NAME = "GameEventProxy";
	
	//public
	
	GameEventProxy.prototype.init = function( p_name, p_data )
	{
		this._super.init.apply( this, [ p_name, p_data ] );
		this.listenNotifications();
	};
	
	GameEventProxy.prototype.listenNotifications = function()
	{
		this.addNotificationListener( ApplicationNotification.LOAD_PROJECT_COMPLETE, this.onNotification );
		this.addNotificationListener( ApplicationNotification.LAUNCH_TRIGGER, this.onNotification );
	};

	GameEventProxy.prototype.onNotification = function( p_notificationType, p_data )
	{
		switch ( p_notificationType )
		{
			case ApplicationNotification.LAUNCH_TRIGGER:	
				this._launchTrigger(p_data); 
				break;
				
			case ApplicationNotification.LOAD_PROJECT_COMPLETE:	
				this._parseEvents(); 
				break;
		}
	};
	
	GameEventProxy.prototype._launchTrigger = function( p_trigger )
	{
		console.log("launch trigger");
	};

	
	// private
	GameEventProxy.prototype._parseEvents = function()
	{
		var proxy = this.getFacade().getProxy( ApplicationProxy.NAME );
		var data = proxy.getGameEvents();
		var i = 0;
		var max = data.length;
		var obj = null;
		
		this._data = new Array();
		
		for( ; i < max; i++ )
		{
			this._data.push( data[i] );
		}
	};
	

	